package com.atguigu.spzx.manager;

//import com.atguigu.spzx.common.config.Knife4jConfig;
import com.atguigu.spzx.common.config.Knife4jConfig;
import com.atguigu.spzx.common.exception.EnableExceptionHandler;
import com.atguigu.spzx.common.exception.SpzxGlobalExceptionHandler;
import com.atguigu.spzx.common.log.anno.EnableSpzxLog;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication//(exclude = DataSourceAutoConfiguration.class)
//微服务要使用的组件 在其他模块的不同包中
//方式1： 指定包扫描
//@ComponentScan(basePackages = {"com.atguigu.spzx.manager",
//    "com.atguigu.spzx.common"})
//方式2:  引入指定组件到spring容器中
//@Import(SpzxGlobalExceptionHandler.class)
//方式3： 自定义Enable注解，注解上通过Import注解赋能引入需要的组件类到容器中
//@EnableExceptionHandler
//方式4： 通过springboot自动配置   springboot项目启动时会自动扫描组件类初始化到容器中
//@Import(value = Knife4jConfig.class)
@EnableTransactionManagement //启用声明式事务管理
@EnableScheduling //开启定时任务
@EnableAsync // 开启异步任务
@EnableSpzxLog //启用日志切面
public class SpzxManagerApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpzxManagerApplication.class , args);
    }
}
